"""AppImage rules for Bazel."""

module(name = "rules_appimage", version = "1.11.0")

bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_python", version = "0.32.2")
bazel_dep(name = "squashfs-tools", version = "4.6.1")
bazel_dep(name = "zstd", version = "1.5.6")

rules_appimage = use_extension("//:extensions.bzl", "appimage_ext_dependencies")
use_repo(
    rules_appimage,
    "appimage_runtime_aarch64",
    "appimage_runtime_i386",
    "appimage_runtime_armv7e-m",
    "appimage_runtime_x86_64",
    "appimagetool.png",
)

register_toolchains("//appimage:all")

_DEFAULT_PYTHON = "3.12"
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(is_default = True, python_version = _DEFAULT_PYTHON)
use_repo(python, "python_" + _DEFAULT_PYTHON.replace(".", "_"), "python_versions", "pythons_hub")
register_toolchains("@pythons_hub//:all")

dev_pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
dev_pip.parse(
    hub_name = "rules_appimage_py_deps",
    python_version = _DEFAULT_PYTHON,
    requirements_lock = "//:requirements.txt",
)
use_repo(dev_pip, "rules_appimage_py_deps")
